package tt.dz.order.schedulingjob;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.quartz.QuartzJobBean;
import org.springframework.stereotype.Component;

import tt.dz.order.exception.BusinessException;
import tt.dz.order.pojo.OrderSummaryReport;

/**
 * @Title 定时汇总报表数据
 * @author nibo
 * @date 2016-08-08
 */
@Component
public class OrderReportSummaryJob extends QuartzJobBean {
	private static Logger log = LoggerFactory.getLogger(OrderReportSummaryJob.class);

	@Override
	protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
		log.info("OrderReportSummaryJob");
		try {
			OrderSummaryReport.createSummary();
		} catch (BusinessException e) {
			log.error("OrderReportSummaryJob:" + e);
			throw new JobExecutionException();
		}
	}

}
